
/*
 * .
 * All Rights Reserved.
 */
package com.model.demo.designmodel.singleton;

/**
 * LazySingleton
 *
 * @author Liao Dongshan, 2019年05月07日
 *
 */
public class LazySingleton {
    private LazySingleton(){};
    private static LazySingleton singleton=null;
    public static  LazySingleton getInstance(){
//        if(singleton==null){
            synchronized (LazySingleton.class){
                if(singleton==null){
                    singleton=new LazySingleton();
                }
            }
//        }
        return singleton;
    }
}
